package com.pgeg.registry;

import com.pgeg.entity.renderer.FutaCowEntityRenderer;
import com.pgeg.listener.EntityListener;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import net.minecraft.client.render.RenderLayer;

import static com.pgeg.listener.CropListener.RICE_CROP;
import static com.pgeg.listener.CropListener.TOMATO_CROP;

public class ClientRegistry {

    @Environment(EnvType.CLIENT)
    public static void registerClient() {
        BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), RICE_CROP);
        BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), TOMATO_CROP);
        EntityRendererRegistry.register(EntityListener.FUTA_COW, (context) -> {
            return new FutaCowEntityRenderer(context);
        });
    }
}